function distance_to_ball = DistanceToBall(P,S,mode)

P_X=P{1}(1);
P_Y=P{1}(2);
P_theta=P{1}(3);
P_num = P{3};

B = S{1};
B_X = B{1}(1);
B_Y = B{1}(2);

distance_to_ball =sqrt((B_X-P_X)^2+(B_Y-P_Y)^2);

end